#!/user/bin/env python
# -*-coding:utf-8-*-
'''
@author: Patty
@project: automation_framework
@file: algo.py
@time: 2020/6/23  13:47
@IDE: PyCharm 
'''

import logging
from util.db_util import execute_query


def get_algoconfig_id(algo_name):
    """获取指定算法名称id

    :param algo_name: 算法名称

    :return: 算法id
    """
    # 查询算法id
    results = execute_query(
        "SELECT id FROM `t_das_algo_config` WHERE algo_name='%s'" % algo_name)
    try:
        result = results[0][0]
        return result
    except Exception as e:
        logging.error("no result retrieved")
        return None
